package br.com.fsa.aplication.Util;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

import org.apache.log4j.Logger;

public class Util {

	
	public static boolean validaData(Calendar _data)
	{
		try
		{
			SimpleDateFormat formatador = new SimpleDateFormat("dd/MM/yyyy");  
			_data.setTime(formatador.parse(_data.toString()));
		}
		catch (Exception e) {
			return false;
		}
		
		return true;
	}
	
	public static void gravaLog( String _msg)
	{
		Logger log = Logger.getLogger("diego");
		log.info(_msg);
	}
	
	public static GregorianCalendar transformaDateToGregoryan(Date _data )
	{
		GregorianCalendar gc = new GregorianCalendar() ;
		
		gc.setTime(_data);
		
		return gc;
	}
}
